Records
Data types
- Data types allow programming languages to provide different classifications for items of data, so they can be used for different purposes.
DECLARE <identifier> : <data type>
DECLARE number : INTEGER
Data type | Description | Pseudocode | Python |
---|---|---|---|
boolean | Logical values, True (1) and False (0) | BOOLEAN | bool |
char | Single alphanumerical character | CHAR | Not used |
date | Value to represent a date | DATE | class datetime |
integer | Whole number, positive or negative | INTEGER | int |
real | Positive or negative number with adecimal point | REAL | float |
string | Sequence of alphanumericalcharacters | STRING | str |
Data types
Filling the data types for pseoducode.
- Logical values, True (1) and False (0):
- Single alphanumerical character:
- Value to represent a date:
- Whole number, positive or negative:
- Positive or negative number with adecimal point:
- Sequence of alphanumerical characters:
[0/6]
Records
- Records are composite data types formed by the inclusion of several related items that may be of different data types.
TYPE
<Typename>
DECLARE <identifier> : <data type>
DECLARE <identifier> : <data type>
DECLARE <identifier> : <data type>
……
ENDTYPE
TYPE
TbookRecord
DECLARE title : STRING
DECLARE author : STRING
DECLARE publisher : STRING
DECLARE noPages : INTEGER
DECLARE fiction : BOOLEAN
ENDTYPE
DECLARE Book : TbookRecord
Book.author ← "David"
Book.fiction ← FALSE
Data types
are composite data types formed by the inclusion of several related items that may be of different data types
[0/1]